package com.effectivejava;

public class FootbalFacts {
	//required fields
	private final int brain;
	private final int strength;
	//optional fields
	private final int coopreation;
	private final int experience;
	
	public static class Builder{
		//required fields
		private final int brain;
		private final int strength;
		//optional fields - initialied the default value
		private int coopreation = 0;
		private int experience = 0;
		
		public Builder(int brain, int strength){
			this.brain = brain;
			this.strength = strength;
		}
		
		public Builder setExperience(int experience){
			this.experience = experience;
			return this;
		}
		
		public Builder setCooperation(int experience){
			this.coopreation = experience;
			return this;
		}
		
		public FootbalFacts bulid(){
			return new FootbalFacts(this);
		}
	}
	
	private FootbalFacts(Builder builder){
		brain = builder.brain;
		strength = builder.strength;
		coopreation = builder.coopreation;
		experience = builder.experience;
	}
	
	public static void main(String[] args){
		FootbalFacts ftf = new FootbalFacts.Builder(100, 100).
								setExperience(100).
								setCooperation(100).bulid();
		
		FootbalFacts ftf1 = new FootbalFacts.Builder(100, 100)
								.setCooperation(100).bulid();
	}
}
